package JAVACORE_TRAINING.OOPs.GENERICS.hieudao;

public class GenericClassDemo<T> {
	private T t;

	public void add(T t) {
		this.t = t;
	}

	public T get() {
		return t;
	}

	public static void main(String[] args) {
		GenericClassDemo<Integer> objInteger = new GenericClassDemo<Integer>();
		GenericClassDemo<String> objString = new GenericClassDemo<String>();

		objInteger.add(new Integer(10));
		objString.add(new String("Hello World"));

		System.out.printf("Gia tri integer la :%d\n\n", objInteger.get());
		System.out.printf("Gia tri string la :%s\n", objString.get());
	}
}
